package com.synnex.mobile.servier.core.calendar.bo;

import com.synnex.mobile.generic.core.util.ObjectUtil;
import com.synnex.mobile.servier.core.calendar.dto.Calendar;
import com.synnex.mobile.servier.web.utils.DateUtil;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: kerryf
 * Date: 13-8-6
 * To change this template use File | Settings | File Templates.
 */
public class CalendarBo {

    private Integer id;
    private Date day;

    private String amIcon;
    private String amIconToday;
    private String amTopic;
    private String amTime;

    private String pmIcon;
    private String pmIconToday;
    private String pmTopic;
    private String pmTime;

    private String noonIcon;
    private String noonIconToday;
    private String noonTopic;
    private String noonTime;

    private String nightIcon;
    private String nightIconToday;
    private String nightTopic;
    private String nightTime;

    private Date entryDate;
    private Date updateDate;

    private String strDate;


    public String getStrDate() {
        return strDate;
    }

    public void setStrDate(String strDate) {
        this.strDate = strDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDay() {
        return day;
    }

    public void setDay(Date day) {
        this.day = day;
    }

    public String getAmIcon() {
        return amIcon;
    }

    public void setAmIcon(String amIcon) {
        this.amIcon = amIcon;
    }

    public String getAmIconToday() {
        return amIconToday;
    }

    public void setAmIconToday(String amIconToday) {
        this.amIconToday = amIconToday;
    }

    public String getAmTopic() {
        return amTopic;
    }

    public void setAmTopic(String amTopic) {
        this.amTopic = amTopic;
    }

    public String getAmTime() {
        return amTime;
    }

    public void setAmTime(String amTime) {
        this.amTime = amTime;
    }

    public String getPmIcon() {
        return pmIcon;
    }

    public void setPmIcon(String pmIcon) {
        this.pmIcon = pmIcon;
    }

    public String getPmIconToday() {
        return pmIconToday;
    }

    public void setPmIconToday(String pmIconToday) {
        this.pmIconToday = pmIconToday;
    }

    public String getPmTopic() {
        return pmTopic;
    }

    public void setPmTopic(String pmTopic) {
        this.pmTopic = pmTopic;
    }

    public String getPmTime() {
        return pmTime;
    }

    public void setPmTime(String pmTime) {
        this.pmTime = pmTime;
    }

    public String getNoonIcon() {
        return noonIcon;
    }

    public void setNoonIcon(String noonIcon) {
        this.noonIcon = noonIcon;
    }

    public String getNoonIconToday() {
        return noonIconToday;
    }

    public void setNoonIconToday(String noonIconToday) {
        this.noonIconToday = noonIconToday;
    }

    public String getNoonTopic() {
        return noonTopic;
    }

    public void setNoonTopic(String noonTopic) {
        this.noonTopic = noonTopic;
    }

    public String getNoonTime() {
        return noonTime;
    }

    public void setNoonTime(String noonTime) {
        this.noonTime = noonTime;
    }

    public String getNightIcon() {
        return nightIcon;
    }

    public void setNightIcon(String nightIcon) {
        this.nightIcon = nightIcon;
    }

    public String getNightIconToday() {
        return nightIconToday;
    }

    public void setNightIconToday(String nightIconToday) {
        this.nightIconToday = nightIconToday;
    }

    public String getNightTopic() {
        return nightTopic;
    }

    public void setNightTopic(String nightTopic) {
        this.nightTopic = nightTopic;
    }

    public String getNightTime() {
        return nightTime;
    }

    public void setNightTime(String nightTime) {
        this.nightTime = nightTime;
    }

    public Date getEntryDate() {
        return entryDate;
    }

    public void setEntryDate(Date entryDate) {
        this.entryDate = entryDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public static CalendarBo createInstance(Calendar calendar){
        if(calendar==null){
            return new CalendarBo();
        }else{
            CalendarBo bo =  ObjectUtil.copyProperties(calendar,CalendarBo.class);
            bo.setStrDate(DateUtil.dateToStr(bo.getDay(),"MM月dd日\nE"));
            return bo;
        }
    }

    public static List<CalendarBo> createInstance(List<Calendar> calendars){

        List<CalendarBo> calendarBos = new ArrayList<CalendarBo>();
        if(calendars!= null && calendars.size()>0){
            for(Calendar calendar: calendars){
                calendarBos.add(createInstance(calendar));
            }
        }
        return calendarBos;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("id: ").append(this.id);
        sb.append("; amTopic: ").append(amTopic);
        sb.append("; pmTopic: ").append(this.pmTopic);
        sb.append("; NightTopic: ").append(this.getNightTopic());
        sb.append("; NoonTopic: ").append(this.getNoonTopic());
        return sb.toString();    //To change body of overridden methods use File | Settings | File Templates.
    }
}
